/*******************************************************************************
 * Copyright (c) 2010, 2030 www.itlaobing.cn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
/**
 * Created by asus-pc on 2017/11/30 0030.
 */

import cn.itlaobing.service.HelloService;

import cn.itlaobing.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClassName: Main <br/>
 * Function: TODO 功能描述 <br/>
 * date: 2017/11/30 0030 11:37 <br/>
 *
 * @author 卖姑娘的小柴火
 * @since JDK 1.8
 */
public class Main {
    public static void main(String[] args) {
        //实例化容器，加载配置文件
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
        //到容器中取出bean对象   getBean对象后面的参数是在applicationContext.xml文件中定义的ID
//        HelloService helloService=(HelloService) applicationContext.getBean("haha");
//        HelloService helloService5=(HelloService) applicationContext.getBean("linana");
//        HelloService helloService1=applicationContext.getBean("hehe",HelloService.class);
//        HelloService helloService2=applicationContext.getBean("s6",HelloService.class);
//        System.out.println(helloService);
//        System.out.println(helloService1);
//        System.out.println(helloService2);
//        System.out.println(helloService5);


//        UserService userService=applicationContext.getBean("userservice",UserService.class);
//        userService.regiester("张三");
        UserService userService =applicationContext.getBean(UserService.class);
        userService.regiester("张三");

    }
}
